package com.ice.framework.utils

import android.content.Context
import android.content.Intent
import android.net.Uri
import android.widget.Toast
import java.util.*


object AppUtil {

    fun toMarket(context: Context){
        try {
            val uri: Uri = Uri.parse("market://details?id=" + context.packageName)
            val intent = Intent(Intent.ACTION_VIEW, uri)
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(intent)
        } catch (e: Exception) {
            Toast.makeText(context, "您的手机没有安装Android应用市场", Toast.LENGTH_SHORT).show()
            e.printStackTrace()
        }
    }

    fun getUUID32():String{
        return UUID.randomUUID().toString().replace("-","").toLowerCase()
    }
}
